<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul,li,a {
            list-style: none;
            text-decoration: none;
            color: black;
            padding: 0;
        }
        li {
            border: solid;
        }
        .ctg {
            width: 400px;
            display: flex;
        }
        .ctg>li{
            flex-grow: 1;
            height: 40px;
            line-height: 40px;
            text-align: center;
            position: relative;
            cursor: pointer;
        }
        .ctg>li>a:hover {
            color: red;
        }
        .ctg>li>ul{
            position: absolute;
            top: 40px;
            left: 0;
            right: 0;
            display: none;
        }
        .ctg>li:hover>ul{
            display: block;
        }
        .ctg>li>ul>li:hover {
            background-color: sandybrown;
        }
    </style>
</head>
<body>
    <ul class="ctg">
        <li>
            <a href="">一级分类</a>
            <ul>
                <li>
                    <a href="">二级分类</a>
                </li>
                <li>
                    <a href="">二级分类</a>
                </li>
                <li>
                    <a href="">二级分类</a>
                </li>
            </ul>
        </li>
        <li>
            <a href="">一级分类</a>
            <ul>
                <li>
                    <a href="">二级分类</a>
                </li>
                <li>
                    <a href="">二级分类</a>
                </li>
                <li>
                    <a href="">二级分类</a>
                </li>
            </ul>
        </li>
        <li>
            <a href="">一级分类</a>
            <ul>
                <li>
                    <a href="">二级分类</a>
                </li>
                <li>
                    <a href="">二级分类</a>
                </li>
                <li>
                    <a href="">二级分类</a>
                </li>
            </ul>
        </li>
    </ul>
    <h3>hello</h3>
</body>
</html>